<?php

class tablaMaestra_model extends CI_Model {

  public function I_Cliente($params) {
        $sql = "call pa_IMCliente(?,?,?,?,?,?)";
        $this->db->query($sql, $params);
    }
   //mostrar combos - tablas
    public function cmbventaTablaMaestra($tabl_tabla_id) {
        $sql = "call usp_venttablamaestragetkey($tabl_tabla_id)";
        $query = $this->db->query($sql);
        if ($query->num_rows() > 0) {
            foreach ($query->result() as $fila) :
                $data[] = $fila;
            endforeach;
        }else {
            $data = null;
        }
        return $data;
    }
     // mostrar combos - sucursal
    
        public function cmbsucursal($sucursal_id) {
        $sql = "call uspvent_listaralmacenxsucursal($sucursal_id)";
        $query = $this->db->query($sql);
        if ($query->num_rows() > 0) {
            foreach ($query->result() as $fila) :
                $data[] = $fila;
            endforeach;
        }else {
            $data = null;
        }
        return $data;
    }
       
    
}

?>